package edu.sdjzu;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

/**
 * OpenFeign 拦截器，用于统一设置请求头
 */
@Component
public class ConsumerRequestInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate requestTemplate) {
        // 统一设置请求头 "source" 的值为 "consumer"
        requestTemplate.header("source", "consumer");
    }
}